<template>
  <div>
    <v-chart ref="vchart" class="chart" :style="height" :option="option" />
  </div>
</template>

<script setup>
import { ref } from "vue";
import { use } from "echarts/core";
import { BarChart, LineChart,PieChart } from "echarts/charts";
import VChart from "vue-echarts";
import { TooltipComponent, GridComponent,LegendComponent  } from "echarts/components";
import { CanvasRenderer } from "echarts/renderers";

use([TooltipComponent, GridComponent, BarChart, LineChart, CanvasRenderer,PieChart,LegendComponent  ]);

const props = defineProps(["height"]);
const { height } = props;
let option = ref({});
const initEcharts = (chartData) => {
  option.value = chartData
};

const vchart = ref(null);
defineExpose({ vchart, initEcharts });
</script>

<style lang="less"></style>
